/* 
 * File:   repository_tree_model.hpp
 * Author: jolo
 *
 * Created on 11. Oktober 2011, 12:24
 */

#ifndef GUI_REPOSITORY_TREE_MODEL_HPP
#define	GUI_REPOSITORY_TREE_MODEL_HPP

#include <widgets/tree_model.hpp>

namespace model
{
    class repository;
    typedef shared_ptr<repository> repository_ptr;
}

namespace widgets {
    class entity_item;
}

namespace gui
{
    
    class repository_tree_model : public widgets::tree_model
    {
        Q_OBJECT
    public:
        repository_tree_model(QObject* p);
        virtual ~repository_tree_model();

    signals:
        void reloaded();

    public slots:
        void on_repository_opened(model::repository_ptr r);
        void on_repository_closed();
        
        void on_create_request(widgets::entity_item* itm);
        void on_edit_request(widgets::entity_item* itm);
        void on_delete_request(widgets::entity_item* itm);
        
    protected:
        model::repository_ptr get_repository();
        
    private:

    };
}

#endif	/* REPOSITORY_TREE_MODEL_HPP */

